/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package wasolicitudesfiec.consultas;
import java.net.SocketException;
import java.sql.*;
/**
 *
 * @author kabad
 */
public class ConexionDBHistorial {
 Connection conHistorial;
    public ConexionDBHistorial() {
    }
public Connection openConexion() {
        try {
            Class.forName("com.mysql.jdbc.Driver");
            if (conHistorial!=null && !conHistorial.isClosed()) {
                conHistorial.close();
            }
//            con = DriverManager.getConnection("jdbc:mysql://192.168.31.2:3306/dbjonashistoria","root","sql");
           conHistorial = DriverManager.getConnection("jdbc:mysql://localhost:3306/dbjonashistoria","root","sql");
           return conHistorial;
        } catch (Exception ex) {
            ex.printStackTrace();
            if (ex instanceof SocketException) {
                SocketException se=(SocketException)ex;
            }
        }
        return null;
    }
}
